<?php
  include "include/config.inc.php";
  if(isset($_POST['sub']))  
  {
  	$partyName = $_POST['partyName'];
  	$address   = $_POST['address'];
  	$city      = $_POST['city'];
  	$phone1    = $_POST['phone1'];
  	$phone2    = $_POST['phone2'];
  	if(isset($_POST['documents']))
  	{
  	  $documents     = implode(',',$_POST['documents']);
  	}
  	else
  	{
  		$documents     = "";
  	}
  	$otherInfo = $_POST['otherInfo'];
  	
  	$insPartyTb="INSERT INTO `party` (`partyName` ,`address` ,`city` ,`phone1` ,`phone2` ,`documentsId` ,`otherInfo`)
  	             VALUES ('".$partyName."',  '".$address."',  '".$city."',  '".$phone1."',  '".$phone2."',  '".$documents."',  '".$otherInfo."')";
  	
  	$insPartyTbRes=mysql_query($insPartyTb);
  }
  $smarty->display('index.tpl');
?>